#include "Creature.h"
#include "Image.h"
#include "Position.h"

Creature::Creature()
{
	m_horizontalOffset	= 0;
	m_verticalOffset	= 0;
	m_direction			= SOUTH;
}

Creature::~Creature()
{
	//
}

Direction Creature::getDirection()
{
	return m_direction;
}

uint8_t Creature::getVerticalOffset()
{
	return m_verticalOffset;
}

uint8_t Creature::getHorizontalOffset()
{
	return m_horizontalOffset;
}
		
void Creature::setOffset(uint8_t x, uint8_t y)
{
	m_horizontalOffset	= x;
	m_verticalOffset	= y;
}

void Creature::draw() const
{
	Position pos = getPosition();
	
	Image* image = Image::getImage(3007);
	if(!image)
		return;
		
	SDL_Rect rect;
	rect.x = (float)pos.x * 43 + m_horizontalOffset - (43 / 4);
	rect.y = (float)pos.y * 43 + m_verticalOffset   - (43 / 4);
	rect.w = 43;
	rect.h = 43;
	image->draw(&rect);
}